//时间变换
function showLocale(objD) {
	var str, colorhead, colorfoot;
	var yy = objD.getYear();
	if(yy < 1900) yy = yy + 1900;
	var MM = objD.getMonth() + 1;
	if(MM < 10) MM = '0' + MM;
	var dd = objD.getDate();
	if(dd < 10) dd = '0' + dd;
	var hh = objD.getHours();
	if(hh < 10) hh = '0' + hh;
	var mm = objD.getMinutes();
	if(mm < 10) mm = '0' + mm;
	var ss = objD.getSeconds();
	if(ss < 10) ss = '0' + ss;
	var ww = objD.getDay();
	if(ww == 0) colorhead = "<font>";
	if(ww > 0 && ww < 7) colorhead = "<font >";
	str = colorhead + yy + "-" + MM + "-" + dd + " &nbsp&nbsp" + hh + ":" + mm + ":" + ss + " ";
	return(str);
}

function tick() {
	var today;
	today = new Date();
	document.getElementById("new_data").innerHTML = showLocale(today);
	window.setTimeout("tick()", 1000);
}

//获取股票基础信息
cNum = '000002';

function getCodeInfo(code) {
	$.ajax({
			url: 'http://qd.10jqka.com.cn/quote.php?cate=real&type=stock&return=json&callback=showStockData&code=' + code,
			type: 'get',
			dataType: 'jsonp',
			contentType: 'application/x-www-form-urlencoded; charset=utf-8'
		})
		.done(function(r) {





		})
		.fail(function() {
			console.log("error");
		});


}


		



function GetQueryString(name)
{
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = decodeURIComponent(window.location.search.substr(1)).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}

$(function() {
	tick();


	//诊股人数增加
	setInterval(function() {
		var penum = parseInt($('#num').text());
		var pe = Math.floor(Math.random() * 5 + 1);
		$('#num').text(penum + pe)
	}, 2500)


});